Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Defining Your Own User Pane Functions /


MyUserPaneDrawProc

NEW WITH THE APPEARANCE MANAGER

Draws the content of your user pane control in the rectangle of user pane control.

The Control Manager declares the type for an application-defined user pane draw function as follows:

typedef pascal void (*ControlUserPaneDrawProc)(
                              ControlHandle control,
                              SInt16 part);
The Control Manager defines the data type ControlUserPaneDrawUPP to identify the universal procedure pointer for this application-defined function:

typedef UniversalProcPtr ControlUserPaneDrawUPP;
You typically use the NewControlUserPaneDrawProc macro like this:

ControlUserPaneDrawUPP myControlUserPaneDrawUPP;
myControlUserPaneDrawUPP = NewControlUserPaneDrawProc(MyUserPaneDraw);

You typically use the CallControlUserPaneDrawProc macro like this:

CallControlUserPaneDrawProc(myControlUserPaneDrawUPP, control, part);

Here's how to declare the function MyUserPaneDrawProc:

pascal void MyUserPaneDrawProc (
                     ControlHandle control,
                     SInt16 part);
control
A handle to the user pane control in which you wish drawing to occur.
part
The part code of the control you should draw. If 0, draw the entire control.
DISCUSSION
Once you have created the function MyUserPaneDrawProc, pass kControlUserPaneDrawProcTag in the tagName parameter of SetControlData.The Control Manager will draw the user pane control with a universal procedure pointer to MyUserPaneDrawProc.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998